package com.example.backend.annotation.constraint;

import com.example.backend.annotation.validation.UserIdValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 自定义用户ID校验注解
 *
 * @author mhwssad
 */
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = UserIdValidator.class)
public @interface ValidUserId {
    String message() default "无效的用户ID";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}

